<template>
	<section class="content-box" v-loading="loading2" element-loading-text="正在加载中">
		<div>
		<!--工具条-->
		<div v-if="Sholist">
			<el-col class="toolbar">
				<el-col :span="12">
					<h2>凭证-模板</h2>
				</el-col>
				<el-col :span="24" style="text-align:right;">
					<el-form :inline="true" :model="filters">
						<el-form-item>
							<el-button type="success" class="el-icon-plus" @click="handleAdd"> 新增</el-button>
						</el-form-item>
						<el-form-item>
							<el-button type="success" class="el-icon-check" @click="CreatVocher()"> 生成凭证</el-button>
						</el-form-item>
					</el-form>
				</el-col>
			</el-col>
			<!--列表-->
			<el-table ref="singleTable" :data="tableData" max-height="700" @row-dblclick='abmo' highlight-current-row  style="width: 100%;" @current-change="handleSelectionChange">
				<el-table-column prop="Voucher_DocNO" label="单号" sortable width="120">
				</el-table-column>
				<el-table-column prop="Voucher_DocDate" label="单号日期" sortable :formatter="formatDate" width="120">
				</el-table-column>
				<el-table-column prop="Voucher_Abstracts" label="摘要" sortable width="666" show-overflow-tooltip>
				</el-table-column>
				<el-table-column prop="TotalJieMoney" label="借方金额" align="right" sortable>
				</el-table-column>
				<el-table-column prop="TotalDaiMoney" label="贷方金额" align="right" sortable>
				</el-table-column>
				<el-table-column prop="DocStatus" label="状态" sortable>
				</el-table-column>
				<el-table-column label="操作" min-width="100">
					<template slot-scope="scope">
						<el-button size="small" v-if="scope.row.DocStatus==='新建'" @row-click.stop="abmo" @click="PZEdit(scope.$index, scope.row)">编辑</el-button>
						<el-button type="danger" v-if="scope.row.DocStatus==='新建'" @row-click.stop="abmo" @click="PzCan(scope.$index, scope.row)" size="small">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
		</div>
		<!--新增界面-->
		<div v-if="SholissAdd">

			<!-- 重布局 -->
			<!-- 导航条 -->
			<div class="flex-top">
				<div>
					<i class="el-icon-arrow-left back" @click="ToBackoth"></i>
					<span style="font-size:20px;vertical-align:middle;margin:0 10px;">
						凭证--模版（新增） </span>
					<small>
					</small>
				</div>
				<!-- 右侧 -->
				<div class="flex">
					<span class="wrapper">
              			<el-button type="info" @click="Referadd" :disabled="ReferaddY"> 
							<i class=""></i> 保存
						</el-button>
						<el-button type="info" @click="ToBackoth">
							<i class=""></i> 返回
						</el-button>
					</span>
				</div>
			</div>
			<!--中部 -->
			<main class="main">
				<div class="main-left">
					<div>
						<h3>单号</h3>
						<strong>{{BjoddNuber}}</strong>
					</div>
					<div>
						<h3>制单日期</h3>
						<div class="flex">
							<el-date-picker type="date" v-model="TraferTime" placeholder="选择日期" :picker-options="pickerOptions0" @change="ZdData">
							</el-date-picker>
						</div>
					</div>
					<div style="margin-bottom:25px;">
						<h3>申请人</h3>
						<strong>
                        {{mingzi}}
                        </strong>&#x3000;
					</div>
				</div>
				<div class="main-right" style="height: 120%">
					<div class="left-form">
						<el-row>
							<el-col :span="7">
								<span>来源单号</span>
								<el-select v-model="addForm.voucher" :disabled="true" placeholder="总账凭证" style="margin-left:6%;width: 56%;">
									<el-option label="区域一" value="shanghai"></el-option>
									<el-option label="区域二" value="beijing"></el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>现金流量</span>
								<el-select v-model="LowItData" placeholder="请选择" style="margin-left:3%;width: 23%;">
									<el-option v-for="item in lowItemRes" :key="item.ID" :label="item.CashFlowItem_Name
" :value="item.CashFlowItem_Code">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="7">
								<span>来源单据</span>
								<el-select v-model='TypeLis' :disabled="true" placeholder="请选择" style="margin-left:6%;width: 56%;">
									<el-option v-for="item in TypeLis_res" :key="item.sex" :label="item.value" :value="item.sex">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>会计期间</span>
								<el-input v-model="deliveryData" :disabled="true" style="width:200px">
								</el-input>
							</el-col>
							<el-col :span="24">
								<span style="vertical-align:top;line-height:10px;">业务描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<textarea cols="111" rows="6" v-model="ChiefAbsTract" style="width: 50%;height: 20%;"></textarea>

							</el-col>
						</el-row>
					</div>
				</div>
			</main>
			<!-- 布局结束 -->

			<div class="budget" style="width:100%">
				<div style="padding:10px;">
					<span>
						<i class="icon iconfont icon-iconfontcolor52"></i> 凭证明细</span>&#x3000;
					<small @click="addlist">添加行</small>
				</div>
				<table class="HideTable" border="1">
					<tr>
						<th id="th1">NO</th>
						<th id="th2">摘要</th>
						<th id="th3">会计科目</th>
						<th id="th4">辅助核算项目</th>
						<th id="th5">借方金额</th>
						<th id="th6">贷方金额</th>
						<th id="th7">操作</th>
					</tr>

					<tr v-for="(i,index) in NowList" :key="index">
						<!-- 遍历初始化的NowList添加行空数据 -->
						<!--行号  -->
						<td>{{index+1}}</td>
						<!-- v-model => 摘要 -->
						<td>
							<el-input v-model="i.AbsTract" @change="AddAbsTract(index,AbsTract)" placeholder="请输入内容" show-overflow-tooltip></el-input>
						</td>
						<!-- 会计科目 -->
						<td>
							<!--<el-input v-model="i.TteName" placeholder="请输入内容"></el-input>-->
							<el-select v-model="i.VoucherLine_AccountItem" filterable placeholder="请选择科目"  @change="fzcx(index)" style="width: 100%;">
								<el-option v-for="item in Listres" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td >

							<el-select v-model="i.fzbumen" filterable  placeholder="新增部门" v-if="i.isCopemer" style="width: 32%;">
								<el-option v-for="item in i.fffffB" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCustomer" filterable  placeholder="新增客户" v-if="i.isCusomer" style="width: 32%;">
								<el-option v-for="item in i.fffffK" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzProduct" filterable  placeholder="新增产品" v-if="i.isProduct" style="width: 32%;">
								<el-option v-for="item in i.fffffC" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCompany" filterable  placeholder="新增公司" v-if="i.isCompany" style="width: 32%;">
								<el-option v-for="item in i.fffffG" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzdaitan" filterable  placeholder="新增待摊" v-if="i.isdaitan" style="width: 32%;">
								<el-option v-for="item in i.fffffD" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzSupplier" filterable  placeholder="新增供应商" v-if="i.isSupplier" style="width: 32%;">
								<el-option v-for="item in i.fffffGYS" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzyajin" filterable  placeholder="新增押金" v-if="i.isyajin" style="width: 32%;">
								<el-option v-for="item in i.fffffYJ" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzEmployee" filterable  placeholder="新增员工" v-if="i.isEmployee" style="width: 32%;">
								<el-option v-for="item in i.fffffY" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td class="inTd" >
							<!-- 借方金额  index,i.YBL_Department -->
							<el-input v-model="i.VoucherLine_JieMoney" placeholder="请输入金额" @change="sumMation(index,i.VoucherLine_JieMoney)" @blur="fuyuW(i,'VoucherLine_JieMoney')"></el-input>
						</td>
						<td >
							<!-- 贷方金额    -->
							<el-input v-model="i.VoucherLine_DaiMoney" placeholder="请输入金额" @change="credit(index,i.VoucherLine_DaiMoney)" @blur="fuyuW(i,'VoucherLine_DaiMoney')"></el-input>
						</td>
						<td>
							<!--操作  -->
							<el-button size="small" @click="handleDelete(index)" type="danger" class="dele">删除</el-button>
						</td>
					</tr>
					<tr>
						<td></td>
						<td></td>
						<td></td>
						<td>合计</td>
						<!-- <td>{{sunang}}</td>
						<td>{{sunbng}}</td> -->
						<td>{{jiefang}}</td>
						<td>{{daifang}}</td>
					</tr>
				</table>
			</div>
		</div>
		
		<!--编辑页面-->
		<div v-if="SholissAdd1">

			<!-- 重布局 -->
			<!-- 导航条 -->
			<div class="flex-top">
				<div>
					<i class="el-icon-arrow-left back" @click="ToBackoth1"></i>
					<span style="font-size:20px;vertical-align:middle;margin:0 10px;">
						凭证-模版（编辑） </span>
					<small>
					</small>
				</div>
				<!-- 右侧 -->
				<div class="flex">
					<span class="wrapper">
						<el-button type="info" @click="EntityUpdate"> 
							<i class=""></i> 保存
						</el-button>
						<el-button type="info" @click="ToBackoth1">
							<i class=""></i> 返回
						</el-button>
					</span>
				</div>
			</div>
			<!--中部 -->
			<main class="main">
				<div class="main-left">
					<div>
						<h3>单号：</h3>
						<strong>{{BjoddNuber}}</strong>
					</div>
					<div>
						<h3>制单日期</h3>
						<div class="flex">
							<el-date-picker type="date" v-model="TraferTime" placeholder="选择日期" :picker-options="pickerOptions0" @change="ZdData">
							</el-date-picker>
						</div>
					</div>
					<div style="margin-bottom:25px;">
						<h3>申请人</h3>
						<strong>
                        {{mingzi}}
                        </strong>&#x3000;
					</div>
				</div>
				<div class="main-right" style="height: 120%">
					<div class="left-form">
						<el-row>
							<el-col :span="7">
								<span>来源单号</span>
								<el-select v-model="addForm.voucher" :disabled="true" placeholder="总账凭证" style="margin-left:6%;width: 56%;">
									<el-option label="区域一" value="shanghai"></el-option>
									<el-option label="区域二" value="beijing"></el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>现金流量</span>
								<el-select v-model="LowItData" placeholder="请选择" style="margin-left:3%;width: 23%;">
									<el-option v-for="item in lowItemRes" :key="item.ID" :label="item.CashFlowItem_Name
" :value="item.CashFlowItem_Code">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="7">
								<span>来源单据</span>
								<el-select v-model='TypeLis' :disabled="true" placeholder="请选择" style="margin-left:6%;width: 56%;">
									<el-option v-for="item in TypeLis_res" :key="item.sex" :label="item.value" :value="item.sex">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>会计期间</span>
								<el-input v-model="deliveryData" :disabled="true" style="width:200px">
								</el-input>
							</el-col>
							<el-col :span="24">
								<span style="vertical-align:top;line-height:10px;">业务描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<textarea cols="111" rows="6" v-model="ChiefAbsTract" style="width: 50%;height: 20%;"></textarea>

							</el-col>
						</el-row>
					</div>
				</div>
			</main>
			<!-- 布局结束 -->

			<div class="budget" style="width:100%">
				<div style="padding:10px;">
					<span>
						<i class="icon iconfont icon-iconfontcolor52"></i> 凭证明细</span>&#x3000;
					<small @click="addlist">添加行</small>
				</div>
				<table class="HideTable" border="1">
					<tr>
						<th id="th1">NO</th>
						<th id="th2">摘要</th>
						<th id="th3">会计科目</th>
						<th id="th4">辅助核算项目</th>
						<th id="th5">借方金额</th>
						<th id="th6">贷方金额</th>
						<th id="th7">操作</th>
					</tr>

					<tr v-for="(i,index) in NowList" :key="index">
						<!-- 遍历初始化的NowList添加行空数据 -->
						<!--行号  -->
						<td>{{index+1}}</td>
						<!-- v-model => 摘要 -->
						<td>
							<el-input v-model="i.AbsTract" @change="AddAbsTract(index,AbsTract)" placeholder="请输入内容" show-overflow-tooltip></el-input>
						</td>
						<!-- 会计科目 -->
						<td >
							<!--<el-input v-model="i.TteName" placeholder="请输入内容"></el-input>-->
							<el-select v-model="i.VoucherLine_AccountItem" filterable placeholder="请选择科目" @change="fzcx(index)" style="width: 100%;">
								<el-option v-for="item in Listres" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td >

							<el-select v-model="i.fzbumen" filterable  placeholder="新增部门" v-if="i.isCopemer" style="width: 32%;">
								<el-option v-for="item in i.fffffB" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCustomer" filterable  placeholder="新增客户" v-if="i.isCusomer" style="width: 32%;">
								<el-option v-for="item in i.fffffK" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzProduct" filterable  placeholder="新增产品" v-if="i.isProduct" style="width: 32%;">
								<el-option v-for="item in i.fffffC" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCompany" filterable  placeholder="新增公司" v-if="i.isCompany" style="width: 32%;">
								<el-option v-for="item in i.fffffG" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzdaitan" filterable  placeholder="新增待摊" v-if="i.isdaitan" style="width: 32%;">
								<el-option v-for="item in i.fffffD" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzSupplier" filterable  placeholder="新增供应商" v-if="i.isSupplier" style="width: 32%;">
								<el-option v-for="item in i.fffffGYS" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzyajin" filterable  placeholder="新增押金" v-if="i.isyajin" style="width: 32%;">
								<el-option v-for="item in i.fffffYJ" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzEmployee" filterable  placeholder="新增员工" v-if="i.isEmployee" style="width: 32%;">
								<el-option v-for="item in i.fffffY" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td class="inTd" >
							<!-- 借方金额  index,i.YBL_Department -->
							<el-input v-model="i.VoucherLine_JieMoney" placeholder="请输入金额" @change="sumMation(index,i.VoucherLine_JieMoney)" @blur="fuyuW(i,'VoucherLine_JieMoney')"></el-input>
						</td>
						<td >
							<!-- 贷方金额    -->
							<el-input v-model="i.VoucherLine_DaiMoney" placeholder="请输入金额" @change="credit(index,i.VoucherLine_DaiMoney)" @blur="fuyuW(i,'VoucherLine_DaiMoney')"></el-input>
						</td>
						<td>
							<!--操作  -->
							<el-button size="small" @click="handleDelete(index)" type="danger" class="dele">删除</el-button>
						</td>
					</tr>
					<tr>
						<td></td>
						<td></td>
						<td></td>
						<td>合计</td>
						<td>{{sunang}}</td>
						<td>{{sunbng}}</td>
						<td></td>
					</tr>
				</table>
			</div>
		</div>
		
		<!--凭证保存页面-->
		<div v-if="SholissAdd2">

			<!-- 重布局 -->
			<!-- 导航条 -->
			<div class="flex-top">
				<div>
					<i class="el-icon-arrow-left back" @click="ToBackoth2"></i>
					<span style="font-size:20px;vertical-align:middle;margin:0 10px;">
						模版转凭证（保存） </span>
					<small>

					</small>
				</div>
				<!-- 右侧 -->
				<div class="flex">
					<span class="wrapper">
						<el-button type="info" @click="EntitySave"> 
							<i class=""></i> 保存
						</el-button>
						<el-button type="info" @click="ToBackoth2">
							<i class=""></i> 返回
						</el-button>
					</span>
				</div>
			</div>
			<!--中部 -->
			<main class="main">
				<div class="main-left">
					<div>
						<h3>单号</h3>
						<strong>{{BjoddNuber}}</strong>
					</div>
					<div>
						<h3>制单日期</h3>
						<div class="flex">
							<el-date-picker type="date" v-model="TraferTime" placeholder="选择日期" :picker-options="pickerOptions0" @change="ZdData">
							</el-date-picker>
						</div>
					</div>
					<div style="margin-bottom:25px;">
						<h3>申请人</h3>
						<strong>
                        {{mingzi}}
                        </strong>&#x3000;
					</div>
				</div>
				<div class="main-right" style="height: 120%">
					<div class="left-form">
						<el-row>
							<el-col :span="7">
								<span>来源单号</span>
								<el-select v-model="addForm.voucher" :disabled="true" placeholder="总账凭证" style="margin-left:6%;width: 56%;">
									<el-option label="区域一" value="shanghai"></el-option>
									<el-option label="区域二" value="beijing"></el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>现金流量</span>
								<el-select v-model="LowItData" placeholder="请选择" style="margin-left:3%;width: 23%;">
									<el-option v-for="item in lowItemRes" :key="item.ID" :label="item.CashFlowItem_Name
" :value="item.CashFlowItem_Code">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="7">
								<span>来源单据</span>
								<el-select v-model='TypeLis' :disabled="true" placeholder="请选择" style="margin-left:6%;width: 56%;">
									<el-option v-for="item in TypeLis_res" :key="item.sex" :label="item.value" :value="item.sex">
									</el-option>
								</el-select>
							</el-col>
							<el-col :span="17">
								<span>会计期间</span>
								<el-input v-model="deliveryData" :disabled="true" style="width:200px">
								</el-input>
							</el-col>
							<el-col :span="24">
								<span style="vertical-align:top;line-height:10px;">业务描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<textarea cols="111" rows="6" v-model="ChiefAbsTract" style="width: 50%;height: 20%;"></textarea>

							</el-col>
						</el-row>
					</div>
				</div>
			</main>
			<!-- 布局结束 -->

			<div class="budget" style="width:100%">
				<div style="padding:10px;">
					<span>
						<i class="icon iconfont icon-iconfontcolor52"></i> 凭证明细</span>&#x3000;
					<small @click="addlist">添加行</small>
				</div>
				<table class="HideTable" border="1">
					<tr>
						<th id="th1">NO</th>
						<th id="th2">摘要</th>
						<th id="th3">会计科目</th>
						<th id="th4">辅助核算项目</th>
						<th id="th5">借方金额</th>
						<th id="th6">贷方金额</th>
						<th id="th7">操作</th>
					</tr>

					<tr v-for="(i,index) in NowList" :key="index">
						<!-- 遍历初始化的NowList添加行空数据 -->
						<!--行号  -->
						<td>{{index+1}}</td>
						<!-- v-model => 摘要 -->
						<td>
							<el-input v-model="i.AbsTract" @change="AddAbsTract(index,AbsTract)" placeholder="请输入内容" show-overflow-tooltip></el-input>
						</td>
						<!-- 会计科目 -->
						<td>
							<!--<el-input v-model="i.TteName" placeholder="请输入内容"></el-input>-->
							<el-select v-model="i.VoucherLine_AccountItem" filterable placeholder="请选择科目" @change="fzcx(index)" style="width: 100%;">
								<el-option v-for="item in Listres" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td >

							<el-select v-model="i.fzbumen" filterable  placeholder="新增部门" v-if="i.isCopemer" style="width: 32%;">
								<el-option v-for="item in i.fffffB" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCustomer" filterable  placeholder="新增客户" v-if="i.isCusomer" style="width: 32%;">
								<el-option v-for="item in i.fffffK" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzProduct" filterable  placeholder="新增产品" v-if="i.isProduct" style="width: 32%;">
								<el-option v-for="item in i.fffffC" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzCompany" filterable  placeholder="新增公司" v-if="i.isCompany" style="width: 32%;">
								<el-option v-for="item in i.fffffG" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzdaitan" filterable  placeholder="新增待摊" v-if="i.isdaitan" style="width: 32%;">
								<el-option v-for="item in i.fffffD" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzSupplier" filterable  placeholder="新增供应商" v-if="i.isSupplier" style="width: 32%;">
								<el-option v-for="item in i.fffffGYS" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzyajin" filterable  placeholder="新增押金" v-if="i.isyajin" style="width: 32%;">
								<el-option v-for="item in i.fffffYJ" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
							<el-select v-model="i.fzEmployee" filterable  placeholder="新增员工" v-if="i.isEmployee" style="width: 32%;">
								<el-option v-for="item in i.fffffY" :key="index" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</td>
						<td class="inTd" >
							<!-- 借方金额  index,i.YBL_Department -->
							<el-input v-model="i.VoucherLine_JieMoney" placeholder="请输入金额" @change="sumMation(index,i.VoucherLine_JieMoney)" @blur="fuyuW(i,'VoucherLine_JieMoney')"></el-input>
						</td>
						<td >
							<!-- 贷方金额    -->
							<el-input v-model="i.VoucherLine_DaiMoney" placeholder="请输入金额" @change="credit(index,i.VoucherLine_DaiMoney)" @blur="fuyuW(i,'VoucherLine_DaiMoney')"></el-input>
						</td>
						<td>
							<!--操作  -->
							<el-button size="small" @click="handleDelete(index)" type="danger" class="dele">删除</el-button>
						</td>
					</tr>
					<tr>
						<td></td>
						<td></td>
						<td></td>
						<td>合计</td>
						<!-- <td>{{sunang}}</td> -->
						<!-- <td>{{sunbng}}</td> -->
						<td>{{jiefang}}</td>
						<td>{{daifang}}</td>
					</tr>
				</table>
			</div>
		</div>
		<!--凭证保存-->
		
		<!--总账凭证-模版查看-->
		<el-dialog :visible.sync="referVisible" :modal-append-to-body="false" >
			<span id="linzi">
				总账凭证-模版
			</span>
			<!--model：false 避免出现模态框-->
			<el-col class="toolbar" style="margin-bottom:20px;margin-top: 40px;">
				<el-row type="flex" class="row-bg" justify="space-around">
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">凭证编号：</span>
					<el-input v-model="pzDocNO" :disabled="true" style="width:150px;float: left;"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">制单日期：</span>
					<el-input v-model="pzDocDate" :disabled="true" style="width:150px;float: left;"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">附件：</span>
					<el-input v-model="value8" :disabled="true" style="width:150px;float: left;"></el-input>
				  </el-col>
				</el-row>
				<!--<el-col :span="24">
					<span>凭证类型：</span>
					<el-input v-model="pingzhengleixing" :disabled="true" style="width:150px"></el-input>
					<span>制单日期：</span>
					<el-input v-model="pzDocDate" :disabled="true" style="width:150px"></el-input>
					<span>单据类型：</span>
					<el-input v-model="laiyuandan" :disabled="true" style="width:150px"></el-input>
					<span>摘要：</span>
					<el-input v-model="pzAbstracts" :disabled="true" style="width:150px"></el-input>
				</el-col>
				<el-col el-col :span="24" style=" margin-bottom: 10px;">
					<span>凭证编号：</span>
					<el-input v-model="pzDocNO" :disabled="true" style="width:150px"></el-input>
					</el-select>
					<span>状态：</span>
					<el-input v-model="yulanzhuangtai" :disabled="true" style="width:150px"></el-input>
					<span>来源单号：</span>
					<el-input v-model="laiyuandanhao" :disabled="true" style="width:150px"></el-input>
				</el-col>-->
			</el-col>
			<el-table :data="SearList" style="width: 100%">
				<!--查询列表 -->
				<el-table-column type="index" label="序号" width="66"></el-table-column>
				<el-table-column property="VoucherLine_AccountItemName" label="会计科目" header-align="center" width="250px"></el-table-column>
				<el-table-column property="VoucherLine_AssistItemName" label="辅助核算" header-align="center" show-overflow-tooltip></el-table-column>
				<el-table-column property="VoucherLine_JieMoney" label="借方" :formatter="dealF"  header-align="center" align="center"></el-table-column>
				<el-table-column property="VoucherLine_DaiMoney" label="贷方" :formatter="dealY"  header-align="center" align="center"></el-table-column>
			</el-table>
			<div id="wang">
				<div style="width:19%;height: 40px;float: left;"></div>
				<div style="width:19%;height: 40px;float: left;"><p>合计</p></div>
				<div style="width:19%;height: 40px;float: left;"></div>
				<div style="width:21.5%;height: 40px;float: left;"><p>{{jiefangheji}}</p></div>
				<div style="width:21.5%;height: 40px;float: left;"><p>{{daifangheji}}</p></div>
			</div>
			
			<div id="fu">
				<div style="width:15%;height: 66px;float: left;"><p>摘要</p></div>
				<textarea style="width:83%;height: 66px;float: left;" cols="111" rows="6" v-model="pzAbstracts"></textarea>
			</div>
			
			<el-col class="EmPennAge" style="margin-bottom:10px;margin-left: 27px;">
				<el-row :gutter="20">
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">单据类型：</span>
					<el-input v-model="laiyuandan" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">现金流类型：</span>
					<el-input v-model="xianjinliu" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">制单：</span>
					<el-input v-model="pzStrCreateBy" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">记账：</span>
					<el-input v-model="yulanjizhang" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				</el-row>
				<el-row :gutter="20" style="margin-top: 10px;margin-bottom: 10px;">
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">来源单号：</span>
					<el-input v-model="laiyuandanhao" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：</span>
					<el-input v-model="yulanzhuangtai" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">出纳：</span>
					<el-input v-model="yulanchuna" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				  <el-col :span="6">
				  	<span style="float: left;line-height: 36px;">审核：</span>
					<el-input v-model="yulanshenhe" :disabled="true" style="width:120px"></el-input>
				  </el-col>
				</el-row>
				<!--<el-col :span="24">
					<span>制单：</span>
					<el-input v-model="pzStrCreateBy" :disabled="true" style="width:150px"></el-input>
					<span>现金流类型：</span>
					<el-input v-model="xianjinliu" :disabled="true" style="width:150px"></el-input>
					<span>借方合计：</span>
					<el-input v-model="jiefangheji" :disabled="true" style="width:150px"></el-input>
					<span>审核：</span>
					<el-input style="width:150px"></el-input>
				</el-col>-->
				<!--<el-col el-col :span="24" style=" margin-bottom: 10px;">
					<span>现金期间：</span>
					<el-input v-model="xianjinqijian" :disabled="true" style="width:150px"></el-input>
					</el-select>
					<span>贷方合计：</span>
					<el-input v-model="daifangheji" :disabled="true" style="width:150px"></el-input>
					<span>出纳：</span>
					<el-input v-model="yulanchuna" :disabled="true" style="width:150px"></el-input>
					<span>记账：</span>
					<el-input v-model="yulanjizhang" :disabled="true" style="width:150px"></el-input>
				</el-col>-->
			</el-col>
		</el-dialog>
		</div>
	</section>
</template>

<script>
	import axios from "../../../util/axios";
	export default {
		name: "proof",
		data() {
			return {
				loading2: false,
				currentRow: null,
				Review: true, //主表，弃审按钮（来源单据为总账凭证且单据状态为已审核，可以弃审）
				sunbLis: true, //主表，提交按钮（只有新建状态可以提交）
				Anti: true, //主表，反记账按钮  （只有状态为已关闭的单据才可以反记账）
				AuThstr: true, //主表，审核按钮（状态为待审核的单据可以审核）
				ChiefAbsTract: '', //主单摘要 
				Debitnuber: '', //借方金额
				creditNuber: '', //贷方金额
				form: {
					name: ""
				},
				TypeLis: "",
				TypeLis_res: [],
				tableData: [], //数据列表
				Period: "", //期间，
				Period_Date: [], //日期集合
				file: "",
				filters: {
					name: ""
				}, //查询项
				arryOgrp: [],
				formLabelWidth: "120px",
				addFormVisible: false,
				AccoUnti: false,
				total: 0, //数据总数
				rows: 10, //每页显示多少条
				currentPage: 1, //当前页数
				dialogFormVisible: false, //控制添加数据的弹框显示关闭
				//新增界面数据
				SholissAdd: false, //新建页面显隐
				SholissAdd1: false, //编辑页面显隐
				SholissAdd2: false, //凭证保存页面显隐
				Sholist: true, //总表单显隐
				addForm: {
					voucher: "", //凭证类型
					tableDate: "", //制表日期
					source: "", //来源单类型
					voucherCode: "", //凭证编号
					statuss: "", //状态
					sourceNum: ""
				}, //来源单号
				TraferTime: "",
				changtimes: "",
				filters: {
					//初始化时间
					column: {
						create_start_date: ""
					}
				},
				pickerOptions0: {
		          disabledDate(time) {
		            return time.getTime() >= Date.now() ;
		          }
		        },

				deliveryData: "", //会计期间
				deliveryData_res:[],//会计期间集合
				AbsTract: "",
				TteName: '', //记录科目搜索框内容
				AssistTypedata: [], //辅助核算列表
				company: '', //公司
				customer: '', //客户
				depart: '', //部门
				employee: '', //员工
				supplier: '', //供应商
				isCopemer: false, //辅助科目部门显隐
				isCompany: false, //辅助科目公司显隐
				isCusomer: false, //辅助科目客户显隐
				isEmployee: false, //辅助科目员工显隐
				isSupplier: false, //辅助科目供应商显隐
				fzbumen: '', //辅助核算部门部分
				fzCompany: '', //辅助核算公司部分
				fzdaitan:'',	//辅助核算待摊部分
				fzCustomer: '', //辅助核算客户部分
				fzEmployee: '', //辅助核算员工部分
				fzSupplier: '', //辅助核算供应商部分
				fzProduct:'',	//辅助核算产品部分
				fzyajin:'', //辅助核算押金部分
				ATCompany: [], //辅助核算公司
				ATCustomer: [],
				ATDepartment: [],
				ATEmployee: [],
				AtSupplier: [],
				NowList: [{
					fzbumen: "", //辅助核算部门部分
					fzCompany: "", //辅助核算公司部分
					fzdaitan:"",	//辅助核算待摊部分
					fzCustomer: "", //辅助核算客户部分
					fzEmployee: "", //辅助核算员工部分
					fzSupplier: "", //辅助核算供应商部分
					fzProduct:"",	//辅助核算产品部分
					fzyajin:"", //辅助核算押金部分	
					AbsTract: '',
					TteName: '',
					ResBist: '',
					VoucherLine_AssistItem: '',
					VoucherLine_AccountItem: '',
					VoucherLine_DaiMoney: '',
					VoucherLine_JieMoney: '',
					fffffB:[],//部门
					fffffK:[],//客户
					fffffC:[],//产品
					fffffG:[],//公司
					fffffD:[],//待摊
					fffffY:[],//员工
					fffffGYS:[],//供应商
					fffffYJ:[],//押金
				}],
				Tresd: '',
				fzInde: '',
				row: null, //获取点击row的单号
				LowItData: "",
				lowItemRes: [],
				dateValue: "",
				Listres: [], //会计科目列表
				SearList: [], //查询单号列表
				value: "",
				KmOption: '',
				AssisCodeRes: '',
				ResBist: '',
				AllDHlisres: [],
				sunang: '', //借方金额
				sunbng: '', //贷方金额
				kjkmId: '', //会计科目ID
				AllfzHs: '', //拼接好的辅助核算Code
				fzbumen: '', //辅助核算部门部分
				fzCompany: '', //辅助核算公司部分
				fzCustomer: '', //辅助核算客户部分
				fzEmployee: '', //辅助核算员工部分
				fzSupplier: '', //辅助核算供应商部分
				OddNumbers: '', //查询单号
				BjoddNuber: '', //编辑单号
				/*****查询数据*******/
				pzDocNO: '', //查询凭证编号
				pzAbstracts: '', //查询凭证摘要
				pzStrCreateBy: '', //查询凭证制单人
				pzDocDate: '',
				referVisible: false, //查询弹框
				AllbjList: [], //凭证编辑总表
				allHandle: [], //批量选取
				pingzhengleixing:'',//预览-凭证类型
		        laiyuandan:'',//预览-来源单据
		        yulanzhuangtai:'',//预览-状态
		        laiyuandanhao:'',//预览-来源单号
		        xianjinliu:'',//预览-现金流类型
		        jiefangheji:'',//预览-借方合计
		        daifangheji:'',//预览-贷方合计
		        xianjinqijian:'',//预览-现金期间
		        yulanchuna:'',//预览-出纳
		        yulanjizhang:'',//预览-记账
		        yulanshenhe:'',//预览-审核
		        AssisC:'',//辅助需要名字
		        AssisList:[],//会计数组
		        options:[],//辅助显示初
		        optionsF:[],//辅助真实
		        value8: '',
		        ReferaddY:false,//内保存按钮禁用
				mingzi:'',
			};

		},
		methods: {
			//时间过滤
	    	formatDate(row, column) {
		      return row.Voucher_DocDate.split("T", 1);
		    },
			ChiAbT() {
				console.log('主凭证', this.ChiefAbsTract);
				this.AbsTract = this.ChiefAbsTract;
				console.log(this.NowList.length)
				for(let i = 0 ; i < this.NowList.length ; i++ ){
					this.NowList[i].AbsTract = this.ChiefAbsTract
				}
			},
			handleSelectionChange(val) { //批量，批量选取
				this.currentRow = val;
		        console.log(this.currentRow,"单击选择")   
			},
			PzCan: function(index, row) { //表单删除
				console.log('选取表单', index, row)
				console.log(row.Voucher_DocNO)
				this.$confirm('确认删除该记录?', '提示', {
					type: 'warning'
				}).then(() => {
					axios.post('EntityDel', {
							DocNo: row.Voucher_DocNO
					}).then((res) => {
						this.$message({
							message: res.Message,
							type: 'success'
						});
						this.getList();
					})
				})
			},
			PZEdit: function(index, row) { //编辑获取单号进而请求数据
				this.loading2 = true
				this.AccountList();
				this.PZlowItem();
				this.getmingzi();
				console.log('获取编辑条目内容', index, row);
				this.SholissAdd1 = true;
				this.SholissAdd = false;
				this.Sholist = false;
				this.BjoddNuber = row.Voucher_DocNO;
				axios.post('Fu_GetEntityByFullName', {
						key: this.BjoddNuber
					})
					.then(res => {
						console.log(res,"页面数据");
						this.ChiefAbsTract = res.Voucher_Abstracts //拿到摘要值（主）
						this.TraferTime = res.Voucher_DocDate//凭证日期
						this.deliveryData = res.Voucher_AccountPeriod//现金期间
						this.LowItData = res.Voucher_CashFlowItem //现金流
						this.AllbjList = res.List_VoucherLine   //获取列表详情
					    console.log(this.AllbjList,"列表详情")
					    
					    console.log(this.NowList,"this.NowList")
					    
						for(let i = 0 ; i < this.AllbjList.length-1 ; i++){
					    	this.NowList.push({
									fzbumen: "", //辅助核算部门部分
									fzCompany: "", //辅助核算公司部分
									fzdaitan:"",	//辅助核算待摊部分
									fzCustomer: "", //辅助核算客户部分
									fzEmployee: "", //辅助核算员工部分
									fzSupplier: "", //辅助核算供应商部分
									fzProduct:"",	//辅助核算产品部分
									fzyajin:"", //辅助核算押金部分	
									AbsTract: '',
									TteName: '',
									ResBist: '',
									VoucherLine_AssistItem: '',
									VoucherLine_AccountItem: '',
									VoucherLine_DaiMoney: '',
									VoucherLine_JieMoney: '',
									fffffB:[],//部门
									fffffK:[],//客户
									fffffC:[],//产品
									fffffG:[],//公司
									fffffD:[],//待摊
									fffffY:[],//员工
									fffffGYS:[],//供应商
									fffffYJ:[],//押金
					    	})
					    }
					    
					    for(let i = 0 ; i < this.AllbjList.length ; i++){
					    		
					    	this.NowList[i].ID = this.AllbjList[i].ID;
					    	
							this.NowList[i].AbsTract = this.AllbjList[i].VoucherLine_Abstracts;
							
							console.log(this.AllbjList[i].VoucherLine_AccountItem,"会计科目")
							this.NowList[i].VoucherLine_AccountItem = this.AllbjList[i].VoucherLine_AccountItem
							
							this.fzcx(i)
							
							this.NowList[i].VoucherLine_JieMoney = this.AllbjList[i].VoucherLine_JieMoney
							
							this.NowList[i].VoucherLine_DaiMoney = this.AllbjList[i].VoucherLine_DaiMoney
							
							this.fanCresit();
							this.cesi();
							
							if(this.AllbjList[i].AssistItemJson != "null"){						
								var AssistItemJson = JSON.parse(this.AllbjList[i].AssistItemJson)
								console.log(AssistItemJson)
								console.log(AssistItemJson.length,"长度")
								for(var l = 0 ; l < AssistItemJson.length ; l++){
									if(AssistItemJson[l].AI_AssistItemType == "Department"){//部门
										this.NowList[i].fzbumen = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Customer"){//客户
										this.NowList[i].fzCustomer = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Product"){//产品
										this.NowList[i].fzProduct = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Company"){//公司
										this.NowList[i].fzCompany = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Employee"){//员工
										this.NowList[i].fzEmployee = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "daitan"){//待摊
										this.NowList[i].fzdaitan = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Supplier"){//供应商
										this.NowList[i].fzSupplier = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "yajin"){//押金
										this.NowList[i].fzyajin = AssistItemJson[l].AI_Code
									}
								}
							}
						}
						this.loading2 = false
					})
					.catch(err => {
						console.log(err)
					})
			},
			abmo: function(row) { //查询 //GetEntityName    查看凭证内容接口
				this.OddNumbers = row.Voucher_DocNO
				axios
					.post('GetEntityByFullNameTemplate', {
						sDocNO: this.OddNumbers
					})
					.then(data => {
						console.log('查询凭证数据查看查询凭证数据查看', data);
						this.pingzhengleixing = data.strDocType //凭证类型
						this.SearList = data.List_VoucherLine //凭证列表(明细)
						this.pzDocDate = data.Voucher_DocDate.substring(0, 10) //制单日期
						this.pzDocNO = data.Voucher_DocNO //凭证编号
						this.pzAbstracts = data.Voucher_Abstracts //显示摘要
						this.pzStrCreateBy = data.strCreateBy //制单人
						this.laiyuandan = data.strSourceDocType //预览-来源单据类型
						this.yulanzhuangtai = data.strDocStatus //预览-状态
						this.laiyuandanhao = data.Voucher_SourceDocNo //预览-来源单号
						this.xianjinliu = data.strCashFlowItem //预览-现金流类型
						this.jiefangheji = data.TotalJieMoney//预览-借方合计
				        this.daifangheji = data.TotalDaiMoney//预览-贷方合计
						this.xianjinqijian = data.Voucher_AccountPeriod //预览-现金期间
						this.yulanchuna = data.strCashBy //预览-出纳
				        this.yulanjizhang = data.strCashBy//预览-记账
						
						
//				        this.laiyuandan = data.,//预览-来源单据
//				        yulanzhuangtai:'',//预览-状态
//				        laiyuandanhao:'',//预览-来源单号
//				        xianjinliu:'',//预览-现金流类型
//				        jiefangheji:'',//预览-借方合计
//				        daifangheji:'',//预览-贷方合计
//				        xianjinqijian:'',//预览-现金期间
//				        yulanchuna:'',//预览-出纳
//				        yulanjizhang:'',//预览-记账
						
						this.referVisible = true;
					})
					.catch(err => {
						console.log('阻止冒泡事件')
					});

			},

			depaself(value) { //辅助部分部门
				let obj = {};
				obj = this.ATDepartment.find((item) => {
					return item.AI_Code === value;
				});
				this.fzbumen = obj.AI_Name
				console.log(obj)
				console.log(this.fzbumen)
			},
			fzgosi(value) { //辅助部分公司
				let obj = {};
				obj = this.ATCompany.find((item) => {
					return item.AI_Code === value;
				});
				this.fzCompany = obj.AI_Name
			},
			fzkehu(value) { //辅助客户部分
				let obj = {};
				obj = this.ATCustomer.find((des) => {
					return des.AI_Code === value;
				});
				this.fzCustomer = obj.AI_Name
			},
			fzyuang(value) {
				let str = {};
				str = this.ATEmployee.find((uye) => {
					return uye.AI_Code === value;
				});
				this.fzEmployee = str.AI_Name
			},
			fzgongying(value) {
				let str = {};
				str = this.AtSupplier.find((items) => {
					return items.AI_Code === value;
				});
				this.fzSupplier = str.AI_Name
			},
			ewEntityrs() {
				axios //默认凭证值=>请求制单日期限制值
					.post("Vouchertity")
					.then(res => {
						var moment = require("moment");
						//console.log(res.Voucher_CreateDate)
						this.TraferTime = res.Voucher_CreateDate
						this.filters.column.create_start_date = res.Voucher_CreateDate;
						if(this.filters.column.create_start_date) {
							this.filters.column.create_start_date = moment(
								this.filters.column.create_start_date
							);
						}
					})
					.catch(err => {
						console.log(err);
					});
			},
			ZdData(data) {
				var str = data;
				this.TraferTime = str;
				this.deliveryData = str.substring(0, 7);
			},
			isBigEnough(value) {
			  return value !== "undefined";
			},
			/******
			 * 模版保存
			 * ********/
			Referadd() {
				if(this.ChiefAbsTract){//主单摘要
					this.Referadd_2();
				}else{
					this.$notify({
						title: '提醒',
						message: '请填写业务描述',
						type: 'warning'
					});
				}
			},	
			Referadd_2(){
				if(this.NowList.length>0){
					this.Referadd_3();
				}else{
					this.$notify({
						title: '提醒',
						message: '请添加凭证明细',
						type: 'warning'
					});
				}
			},								
			Referadd_3(){
				this.loading2 = true
				this.ReferaddY =true
				let fulyu = []
				let shiqianli = []
				console.log(this.NowList);
				console.log(this.NowList.length);
				for(let i = 0 ; i < this.NowList.length ; i++){
					if(this.NowList[i].VoucherLine_AccountItem == '' ){
						fulyu = this.NowList.splice(i,1)
					}
				}
				console.log(fulyu)
				console.log(this.NowList)
				for(let l = 0 ; l < this.NowList.length ; l++){
					let filtered1 = this.NowList[l].fzCustomer+','+this.NowList[l].fzProduct+','+this.NowList[l].fzbumen+','+this.NowList[l].fzCompany+','+this.NowList[l].fzdaitan+','+this.NowList[l].fzEmployee+','+this.NowList[l].fzSupplier+','+this.NowList[l].fzyajin
					console.log(filtered1)
					let filtered2 = filtered1.split(',')
					console.log(filtered2)
					let filtered3 = filtered2.filter(this.isBigEnough)
					console.log(filtered3,"111111111111111111")
					let filtered4 = filtered3.join(',')
					console.log(filtered4)				
					let fuyufuyu = {
						VoucherLine_AbsTracts: this.NowList[l].AbsTract,
						TteName: this.NowList[l].TteName,
						ResBist: this.NowList[l].ResBist,
						VoucherLine_AssistItem: filtered4,
						VoucherLine_AccountItem: this.NowList[l].VoucherLine_AccountItem,
						VoucherLine_DaiMoney: this.NowList[l].VoucherLine_DaiMoney,
						VoucherLine_JieMoney: this.NowList[l].VoucherLine_JieMoney,
					}
					shiqianli.push(fuyufuyu)
				}
				console.log(shiqianli)
				let AllTent = {
							ID: this.BjoddNuber,
					        Voucher_DocType: 101,//凭证类型
					        Voucher_DocDate: this.TraferTime,//凭证日期
					        Voucher_SourceDocType: 101,//原单类型(凭证类型)
					        Voucher_Abstracts: this.ChiefAbsTract,//主单摘要
					        Voucher_DocNO: "新建",//不改
					        Voucher_DocStatus: "1",//不改
					        Voucher_SourceDocNo: "",//不改
					        Voucher_CashFlowItem: this.LowItData,// 现金流(现金流量类型)
					        Voucher_AccountPeriod: this.deliveryData,//会计期间
					        List_VoucherLine: shiqianli
				}
					console.log(AllTent)
					//增加凭证 接口’EntityAdd‘
				axios.post('TEntityAdd', AllTent)
					.then((res) => {
						console.log(res)
						this.loading2 = false
						this.getList()
						if(res.Success){
							this.SholissAdd = false; //新建页面隐藏
							this.Sholist = true; //查询总表显示  //控制返回
							this.$notify({
								title: '提醒',
								message: res.Message,
								type: 'success'
							});	
						}

					}).catch((err) => {
						console.log(err)
						this.$notify({
								title: '提醒',
								message: err.Message,
								type: 'warning'
							});
					});
			},
			/*******
			 ******编辑保存（更新）
			 ***/
			EntityUpdate() {
				if(this.ChiefAbsTract){//主单摘要
					this.EntityUpdate_2();
				}else{
					this.$notify({
						title: '提醒',
						message: '请填写业务描述',
						type: 'warning'
					});
				}
			},	
			EntityUpdate_2(){
				if(this.NowList.length>0){
					this.EntityUpdate_3();
				}else{
					this.$notify({
						title: '提醒',
						message: '请添加凭证明细',
						type: 'warning'
					});
				}
			},								
			EntityUpdate_3(){
				this.loading2 = true
				let fulyu = []
				let shiqianli = []
				console.log(this.NowList,"1111111111");
				console.log(this.NowList.length);
				for(let i = 0 ; i < this.NowList.length ; i++){
					if(this.NowList[i].VoucherLine_DaiMoney == '' && this.NowList[i].VoucherLine_JieMoney == ''){
						fulyu = this.NowList.splice(i,1)
					}
				}
				console.log(fulyu)
				console.log(this.NowList)
				for(let l = 0 ; l < this.NowList.length ; l++){
					let filtered1 = this.NowList[l].fzCustomer+','+this.NowList[l].fzProduct+','+this.NowList[l].fzbumen+','+this.NowList[l].fzCompany+','+this.NowList[l].fzdaitan+','+this.NowList[l].fzEmployee+','+this.NowList[l].fzSupplier+','+this.NowList[l].fzyajin
					console.log(filtered1)
					let filtered2 = filtered1.split(',')
					let filtered3 = filtered2.filter(this.isBigEnough)
					let filtered4 = filtered3.join(',')
					console.log(filtered2)
					console.log(filtered3,"111111111111111111")
					let fuyufuyu = {
						ID: this.NowList[l].ID,
						VoucherLine_AbsTracts: this.NowList[l].AbsTract,
						TteName: this.NowList[l].TteName,
						ResBist: this.NowList[l].ResBist,
						VoucherLine_AssistItem: filtered4,
						VoucherLine_AccountItem: this.NowList[l].VoucherLine_AccountItem,
						VoucherLine_DaiMoney: this.NowList[l].VoucherLine_DaiMoney,
						VoucherLine_JieMoney: this.NowList[l].VoucherLine_JieMoney,
					}
					shiqianli.push(fuyufuyu)
				}
				console.log(shiqianli)
				let AllMenu = {
							ID: "0",	
					        Voucher_DocType: 101,//凭证类型
					        Voucher_DocDate: this.TraferTime,//凭证日期
					        Voucher_SourceDocType: 101,//原单类型(凭证类型)
					        Voucher_Abstracts: this.ChiefAbsTract,//主单摘要
					        Voucher_DocNO: this.BjoddNuber,//凭证号
					        Voucher_DocStatus: "1",//不改
					        Voucher_SourceDocNo: "",//不改
					        Voucher_CashFlowItem: this.LowItData,// 现金流(现金流量类型)
					        Voucher_AccountPeriod: this.deliveryData,//现金期间
					        List_VoucherLine: shiqianli
				}
				console.log(AllMenu)
				axios.post('EntityUpdate', AllMenu)
					.then((res) => {
						console.log(res)
						this.$notify({
							title: '提醒',
							message: '保存成功',
							type: 'success'
						});						
						this.loading2 = false;
						this.getList();
						if(res.Success){
							this.SholissAdd1 = false; //编辑页面隐藏
							this.Sholist = true; //查询总表显示  //控制返回
							this.$notify({
								title: '提醒',
								message: res.Message,
								type: 'success'
							});	
						}
					})
					.catch((err) => {
						console.log(err)
						this.$notify({
								title: '提醒',
								message: err.Message,
								type: 'warning'
							});
					});

			},
			
			/*******
			 ******模版转凭证保存（保存）
			 ***/
			EntitySave() {
				if(this.ChiefAbsTract){//主单摘要
					this.EntitySave_2();
				}else{
					this.$notify({
						title: '提醒',
						message: '请填写业务描述',
						type: 'warning'
					});
				}
			},	
			EntitySave_2(){
				if(this.NowList.length>0){
					this.EntitySave_3();
				}else{
					this.$notify({
						title: '提醒',
						message: '请添加凭证明细',
						type: 'warning'
					});
				}
			},								
			EntitySave_3(){
				this.loading2 = true
				let fulyu = []
				let shiqianli = []
				console.log(this.NowList);
				console.log(this.NowList.length);
				for(let i = 0 ; i < this.NowList.length ; i++){
					if(this.NowList[i].VoucherLine_AccountItem == '' ){
						fulyu = this.NowList.splice(i,1)
					}
				}
				console.log(fulyu)
				console.log(this.NowList)
				for(let l = 0 ; l < this.NowList.length ; l++){
					let filtered1 = this.NowList[l].fzCustomer+','+this.NowList[l].fzProduct+','+this.NowList[l].fzbumen+','+this.NowList[l].fzCompany+','+this.NowList[l].fzdaitan+','+this.NowList[l].fzEmployee+','+this.NowList[l].fzSupplier+','+this.NowList[l].fzyajin
					console.log(filtered1)
					let filtered2 = filtered1.split(',')
					let filtered3 = filtered2.filter(this.isBigEnough)
					let filtered4 = filtered3.join(',')
					console.log(filtered2)
					console.log(filtered3,"111111111111111111")
					let fuyufuyu = {
						VoucherLine_AbsTracts: this.NowList[l].AbsTract,
						TteName: this.NowList[l].TteName,
						ResBist: this.NowList[l].ResBist,
						VoucherLine_AssistItem: filtered4,
						VoucherLine_AccountItem: this.NowList[l].VoucherLine_AccountItem,
						VoucherLine_DaiMoney: this.NowList[l].VoucherLine_DaiMoney,
						VoucherLine_JieMoney: this.NowList[l].VoucherLine_JieMoney,
					}
					shiqianli.push(fuyufuyu)
				}
				console.log(shiqianli)	
				let AllMenu = {
							ID: this.BjoddNuber,	
					        Voucher_DocType: 101,//凭证类型
					        Voucher_DocDate: this.TraferTime,//凭证日期
					        Voucher_SourceDocType: 101,//原单类型(凭证类型)
					        Voucher_Abstracts: this.ChiefAbsTract,//主单摘要
					        Voucher_DocNO: "新建",//凭证号
					        Voucher_DocStatus: "1",//不改
					        Voucher_SourceDocNo: "",//不改
					        Voucher_CashFlowItem: this.LowItData,// 现金流(现金流量类型)
					        Voucher_AccountPeriod: this.deliveryData,//现金期间
					        List_VoucherLine: shiqianli
				}
				console.log(AllMenu)
				axios.post('EntityAdd', AllMenu)
					.then((res) => {
						console.log(res)
						this.loading2 = false
						if(res.Success){
//							this.SholissAdd2 = false; //编辑页面隐藏
//							this.Sholist = true; //查询总表显示  //控制返回
							this.$router.replace('/proof')
							this.$notify({
								title: '提醒',
								message: res.Message,
								type: 'success'
							});	
						}else{
							this.$notify({
								title: '提醒',
								message: res.Message,
								type: 'warning'
							});
						}
					})
					.catch((err) => {
						
					});

			},
			
			
			SaveAll() {
				let AllMenu = {
					        Voucher_DocType: 101,//凭证类型
					        Voucher_DocDate: this.TraferTime,//凭证日期
					        Voucher_SourceDocType: 101,//原单类型(凭证类型)
					        Voucher_Abstracts: this.ChiefAbsTract,//主单摘要
					        Voucher_DocNO: this.BjoddNuber,//凭证号
					        Voucher_DocStatus: "1",//不改
					        Voucher_SourceDocNo: "",//不改
					        Voucher_CashFlowItem: this.LowItData,// 现金流(现金流量类型)
					        Voucher_AccountPeriod: this.deliveryData,//现金期间
					        List_VoucherLine: this.NowList
				}
				console.log(AllMenu)
				axios.post('VoSubmit', AllMenu)
					.then((res) => {
						console.log(res)
						this.$notify({
							title: '提醒',
							message: '保存成功',
							type: 'success'
						});
						this.SholissAdd = false; //新建页面隐藏
						this.Sholist = true; //查询总表显示  //控制返回
						this.getList();
					})
					.catch((err) => {
						
					});

			},

			/******
			 ******凭证明细添加行
			 ***/
			addlist() {
				//添加行
				// this.NowList.length=0; //清零
//				this.NowList[0].VoucherLine_Abstracts = this.ChiefAbsTract
				this.NowList.push({
					VoucherLine_Abstracts: this.ChiefAbsTract,
					AbsTract: this.ChiefAbsTract,
					TteName: '',
					ResBist: '',
					VoucherLine_AssistItem: '',
					VoucherLine_AccountItem: '',
					VoucherLine_DaiMoney: '',
					VoucherLine_JieMoney: '',
					ID:0,
				});
				// this.NowList.push({VoucherLine_Abstracts:this.AbsTract});
				console.log(this.NowList);
			},
			AddAbsTract(index,e) {
				console.log(e,"明细摘要")
				console.log(index,"明细摘要")
				this.NowList[index].VoucherLine_Abstracts = e;
			},

			// this.personArr.unshift(this.newPerson);

			fzcx(index) { //打开辅助核算
				console.log(index)
				console.log(this.NowList, '请求表');
				console.log(this.NowList[index].VoucherLine_AccountItem)

				console.log(this.NowList[index],'1111')
				this.$set(this.NowList[index],'isCopemer',false);//部门
				this.$set(this.NowList[index],'isCusomer',false);//客户
				this.$set(this.NowList[index],'isProduct',false);//产品
				this.$set(this.NowList[index],'isdaitan',false);//待摊
				this.$set(this.NowList[index],'isCompany',false);//公司
				this.$set(this.NowList[index],'isEmployee',false);//员工
				this.$set(this.NowList[index],'isSupplier',false);//供应商
				this.$set(this.NowList[index],'isyajin',false);//押金
				console.log(this.NowList[index],'2222')
				axios.post('Fu_GetAssistItemTypes', { //拿到值，判断
						AccountItem: this.NowList[index].VoucherLine_AccountItem,
					}).then(res => {
						console.log(res,"请求的数据")
						for(var i = 0 ; i < res.length ; i++){
							this.AssisC = res[i].Code

							if(this.AssisC == "Department"){//部门
								var storage=window.localStorage;
								if(storage.fffffB){
									this.NowList[index].isCopemer = true
									this.$set(this.NowList[index],'fffffB',JSON.parse(storage.fffffB));
								}else{
									console.log("进入部门")
									this.NowList[index].isCopemer = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffB',Details);
									        var a=JSON.stringify(Details);
									        storage.setItem("fffffB",a);
									   })
								}
							}
							else if(this.AssisC == "Customer"){//客户
								var storage=window.localStorage;
								if(storage.fffffK){
									this.NowList[index].isCusomer = true
									this.$set(this.NowList[index],'fffffK',JSON.parse(storage.fffffK));
								}else{
									console.log("进入客户")
									this.NowList[index].isCusomer = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffK',Details);
									        var b=JSON.stringify(Details);
									        storage.setItem("fffffK",b);
									    })
								}	
							}
							else if(this.AssisC == "Product"){//产品
								var storage=window.localStorage;
								if(storage.fffffC){
									this.NowList[index].isProduct = true
									this.$set(this.NowList[index],'fffffC',JSON.parse(storage.fffffC));
								}else{
									console.log("进入产品")
									this.NowList[index].isProduct = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffC',Details);
									        var c=JSON.stringify(Details);
									        storage.setItem("fffffC",c);
									    })
								}	
							}
							else if(this.AssisC == "daitan"){//待摊
								var storage=window.localStorage;
								if(storage.fffffD){
									this.NowList[index].isdaitan = true
									this.$set(this.NowList[index],'fffffD',JSON.parse(storage.fffffD));
								}else{
									console.log("进入待摊")
									this.NowList[index].isdaitan = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffD',Details);
									        var d=JSON.stringify(Details);
									        storage.setItem("fffffD",d);
									    })
								}	
							}
							else if(this.AssisC === "Company"){//公司
								var storage=window.localStorage;
								if(storage.fffffG){
									this.NowList[index].isCompany = true
									this.$set(this.NowList[index],'fffffG',JSON.parse(storage.fffffG));
								}else{
									console.log("进入公司")
									this.NowList[index].isCompany = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffG',Details);
									        var e=JSON.stringify(Details);
									        storage.setItem("fffffG",e);
									    })
								}	
							}
							else if(this.AssisC == "Employee"){//员工
								var storage=window.localStorage;
								if(storage.fffffY){
									this.NowList[index].isEmployee = true
									this.$set(this.NowList[index],'fffffY',JSON.parse(storage.fffffY));
								}else{
									console.log("进入员工")
									this.NowList[index].isEmployee = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffY',Details);
									        var f=JSON.stringify(Details);
									        storage.setItem("fffffY",f);
									    })
								}	
							}
							else if(this.AssisC == "Supplier"){//供应商
								var storage=window.localStorage;
								if(storage.fffffGYS){
									this.NowList[index].isSupplier = true
									this.$set(this.NowList[index],'fffffGYS',JSON.parse(storage.fffffGYS));
								}else{
									console.log("进入供应商")
										this.NowList[index].isSupplier = true
										axios
											.post('istItemdata', { //拿到值，判断
												strType: this.AssisC,
											})
											.then(res => {
												let Details = []
										        for(let i = 0 ; i<res.length ; i++ ){
										        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
										        	Details.push(Data)
										        }
										        this.$set(this.NowList[index],'fffffGYS',Details);
										        var g=JSON.stringify(Details);
										        storage.setItem("fffffGYS",g);
										    })
								}		
							}
							else if(this.AssisC == "yajin"){//押金
								var storage=window.localStorage;
								if(storage.fffffYJ){
									this.NowList[index].isyajin = true
									this.$set(this.NowList[index],'fffffYJ',JSON.parse(storage.fffffYJ));
								}else{
									console.log("进入押金")
									this.NowList[index].isyajin = true
									axios
										.post('istItemdata', { //拿到值，判断
											strType: this.AssisC,
										})
										.then(res => {
											let Details = []
									        for(let i = 0 ; i<res.length ; i++ ){
									        	let Data = { value: res[i].AI_Code , label: res[i].AI_Name}
									        	Details.push(Data)
									        }
									        this.$set(this.NowList[index],'fffffYJ',Details);
									        var h=JSON.stringify(Details);
									        storage.setItem("fffffYJ",h);
									    })
									}
							}
						}
					})		
				//清除选项          
			},
			changSele(index) {
				console.log(index)
			},  
			sumMation(index, Debitnuber) { //借方金额
				if(this.NowList[index].VoucherLine_DaiMoney){
					this.NowList[index].VoucherLine_DaiMoney = ''
				}
				this.Debitnuber = Debitnuber
				this.NowList[index].VoucherLine_JieMoney = this.Debitnuber
				console.log(this.NowList)
				this.cesi()
			},
			credit(index, creditNuber) { //贷方金额
				if(this.NowList[index].VoucherLine_JieMoney){
					this.NowList[index].VoucherLine_JieMoney = ''
				}
				this.creditNuber = creditNuber
					//creditNuber:贷方金额
				this.NowList[index].VoucherLine_DaiMoney = this.creditNuber
				console.log(this.NowList)
				this.fanCresit()
			},
			fuyuW(num,attr1,attr2){
				console.log(num,`num`);
				if (this.isUndefined(attr2)) {//有attr1,没有attr2
					if (!this.isFalse(num[attr1])) {
						num[attr1]=Math.round(Number(num[attr1])*100)/100;
					}  
				}else{////有attr1,有attr2
					if (!this.isFalse(num[attr1][attr2])) {   
						num[attr1][attr2]=Math.round(Number(num[attr1][attr2])*100)/100
					}
				}
				this.Debitnuber = ''
				this.creditNuber = ''
			},
			fanCresit() { //贷方金额叠加
				let bng = 0;
				let addCrit = [];
				this.NowList.forEach(function(item, index) {
					/* item.VoucherLine_DaiMoney == '' ? item.VoucherLine_DaiMoney = 0 : item.VoucherLine_DaiMoney */
					addCrit.push(item.VoucherLine_DaiMoney)
				});
				addCrit.forEach(function(item, index) {
					item = Number(item); /* +陈冠成 */
					/* let Rizi = parseFloat(item) /陈冠成/*/
					let Rizi = Math.round(parseFloat(item) * 100)/100;
					return bng += Rizi
				});
				this.sunbng = bng.toFixed(2);
			},
			cesi() { //借方金额叠加
				var ang = 0;
				var addsun = [];
				this.NowList.forEach(function(item, index) {
					/* item.VoucherLine_JieMoney == '' ? item.VoucherLine_JieMoney = 0 : item.VoucherLine_JieMoney */
					addsun.push(item.VoucherLine_JieMoney)
				});
				//Debitnuber:借方金额
				addsun.forEach(function(item, index) {
					item = Number(item); /* +陈冠成 */
					/* var num = parseFloat(item); /陈冠成/*/
					var num = Math.round(parseFloat(item) * 100)/100;
					return ang += num
				});
				this.sunang = ang.toFixed(2);
			},

			//  allsun(){
			//  // return parseInt(this.number1) + parseInt(this.number2)
			//  //forEach(function(index, item) { })
			//  let sumAdd = 0
			//   this.NowList.forEach(function(index,item){
			//      sumAdd =+ item.number1[index]
			//  });
			//  console.log(sumAdd)
			// },

			dangjuFrom() { //转换后台json格式
				axios
					.post("DocTypeList")
					.then(res => {
						var jsonStr = res;
						var jsonObj = JSON.parse(jsonStr);
						//console.log(jsonObj);
						function getobj(sexValue, value) {
							var obj = {
								sex: sexValue,
								value: value
							};
							return obj;
						}
						var arry = [];
						for(var prop in jsonObj) {
							var sexVal = prop;
							var value = jsonObj[prop];

							var obj = getobj(prop, value);
							arry.push(obj);
							//console.log(arry)
							this.arryOgrp = arry;
						}
						this.TypeLis_res = this.arryOgrp;
//						this.TypeLis = this.arryOgrp[0].value;

					})
					.catch(err => {
						console.log(err);
					});
			},
			cxDta() {
				//console.log(this.Period+"123")
				this.getList();
			},
			PZlowItem() {
				//现金流类型
				axios
					.post("lowItem")
					.then(res => {
						this.lowItemRes = res;
						console.log('现金流类型', this.lowItemRes)
					})
					.catch(err => {
						console.log(err);
					});
			},

			AccountList() {
				axios
					.post('CXAccountItem')
					.then(res => {
						console.log(res,"会计科目列表")
				        console.log(res.length)
				        let Details = []
				        for(let i = 0 ; i<res.length ; i++ ){
				        	let Data = { value: res[i].AccountItem_Code , label: res[i].AccountItem_Code+res[i].AccountItem_FullName , AssistItemTypeCode:res[i].AssistItemTypeCode}
				        	Details.push(Data)
				        }
				        this.Listres = Details
					})
					.catch(err => {
						console.log(err);
					});
			},

			getList() { //主列表
				this.loading2 = true
				console.log(this.currentPage)
				console.log(this.rows)
				axios
					.post("GridPageListJsonTemplate", {
						page: 1, //当前页数，
						rows: 10000, // 每页多少条
					})
					.then(data => {
						this.NowList = [{
							fzbumen: "", //辅助核算部门部分
							fzCompany: "", //辅助核算公司部分
							fzdaitan:"",	//辅助核算待摊部分
							fzCustomer: "", //辅助核算客户部分
							fzEmployee: "", //辅助核算员工部分
							fzSupplier: "", //辅助核算供应商部分
							fzProduct:"",	//辅助核算产品部分
							fzyajin:"", //辅助核算押金部分	
							AbsTract: '',
							TteName: '',
							ResBist: '',
							VoucherLine_AssistItem: '',
							VoucherLine_AccountItem: '',
							VoucherLine_DaiMoney: '',
							VoucherLine_JieMoney: '',
							fffffB:[],//部门
							fffffK:[],//客户
							fffffC:[],//产品
							fffffG:[],//公司
							fffffD:[],//待摊
							fffffY:[],//员工
							fffffGYS:[],//供应商
							fffffYJ:[],//押金
						}];
						this.total = data.total;
						this.tableData = data.rows; //客户列表渲染到表格上
						console.log('总列表', data);
						this.loading2 = false
					})
					.catch(err => {
						console.log(err);
					});
			},
		
			
			addItem() {},
			//添加
			add() {
				this.tableData2.push(this.form);
				this.dialogFormVisible = false;
			},
			//删除
			handleDelete(index, row) {
				this.$confirm('确认删除?', '提示', {
					type: 'warning'
				}).then(() => {	
					this.NowList.splice(index, 1);
					this.fanCresit(); //贷方金额叠加
					this.cesi(); //借方金额叠加
					this.Debitnuber = ''
					this.creditNuber = ''
					this.$message({
						message: "删除成功",
						type: 'success'
					});
				})	
			},
			//编辑
			modify(index, row) {
				var that = this;
				this.$prompt("修改姓名", "编辑", {
						confirmButtonText: "保存",
						cancelButtonText: "取消",
						inputValue: row.name
					})
					.then(function({
						value
					}) {
						//编辑保存
						row.name = value;
					})
					.catch(function() {
						//编辑取消
						that.$message({
							type: "info",
							message: "取消编辑"
						});
					});
			},
			handleAdd: function() {
				this.AccountList();
				this.PZlowItem();
				this.ewEntityrs();
				this.getmingzi();
				//显示新增界面
				this.ReferaddY = false
				this.BjoddNuber = '';
				this.LowItData = '';//现金流
				this.ChiefAbsTract = '';//主摘要
				this.sunang = '';
				this.sunang = '';
				this.NowList = [{
					AbsTract: '',
					TteName: '',
					ResBist: '',
					VoucherLine_AssistItem: '',
					VoucherLine_AccountItem: '',
					VoucherLine_DaiMoney: '',
					VoucherLine_JieMoney: '',
				},{
					AbsTract: '',
					TteName: '',
					ResBist: '',
					VoucherLine_AssistItem: '',
					VoucherLine_AccountItem: '',
					VoucherLine_DaiMoney: '',
					VoucherLine_JieMoney: '',
				},{
					AbsTract: '',
					TteName: '',
					ResBist: '',
					VoucherLine_AssistItem: '',
					VoucherLine_AccountItem: '',
					VoucherLine_DaiMoney: '',
					VoucherLine_JieMoney: '',
				}];
				this.SholissAdd = true; //新建页面显示
				this.Sholist = false; //查询总表隐藏
			},
			ToBackoth: function() {
				window.location.reload();
			},
			ToBackoth1: function() {
				window.location.reload();
			},
			ToBackoth2: function() {
				window.location.reload();
			},
			CreatVocher(){
				console.log(this.currentRow.Voucher_DocNO)
				this.$confirm('确认把模版转为凭证?', '提示', {
					type: 'warning'
				}).then(() => {
					/* this.loading2 = true */
					this.ewEntityrs();
					this.AccountList();
					this.PZlowItem();
					this.getmingzi();
					this.SholissAdd2 = true;
					this.Sholist = false;
					axios.post('Fu_GetEntityByFullName', {
							key: this.currentRow.Voucher_DocNO
						})
						.then(res => {
							console.log(res,"单据数据");
						this.ChiefAbsTract = res.Voucher_Abstracts //拿到摘要值（主）
//						this.TraferTime = res.Voucher_DocDate//凭证日期
//						this.deliveryData = res.Voucher_CashPeriod//现金期间
						this.LowItData = res.Voucher_CashFlowItem //现金流
						this.AllbjList = res.List_VoucherLine   //获取列表详情
					    console.log(this.AllbjList,"列表详情")
					    
					    console.log(this.NowList,"this.NowList")
					    
						for(let i = 0 ; i < this.AllbjList.length-1 ; i++){
					    	this.NowList.push({
									fzbumen: "", //辅助核算部门部分
									fzCompany: "", //辅助核算公司部分
									fzdaitan:"",	//辅助核算待摊部分
									fzCustomer: "", //辅助核算客户部分
									fzEmployee: "", //辅助核算员工部分
									fzSupplier: "", //辅助核算供应商部分
									fzProduct:"",	//辅助核算产品部分
									fzyajin:"", //辅助核算押金部分	
									AbsTract: '',
									TteName: '',
									ResBist: '',
									VoucherLine_AssistItem: '',
									VoucherLine_AccountItem: '',
									VoucherLine_DaiMoney: '',
									VoucherLine_JieMoney: '',
									fffffB:[],//部门
									fffffK:[],//客户
									fffffC:[],//产品
									fffffG:[],//公司
									fffffD:[],//待摊
									fffffY:[],//员工
									fffffGYS:[],//供应商
									fffffYJ:[],//押金
					    	})
					    }
					    
					    for(let i = 0 ; i < this.AllbjList.length ; i++){					    							    					
					    	this.NowList[i].ID = this.AllbjList[i].ID;
							this.NowList[i].AbsTract = this.AllbjList[i].VoucherLine_Abstracts;
							console.log(this.AllbjList[i].VoucherLine_AccountItem,"会计科目")
							this.NowList[i].VoucherLine_AccountItem = this.AllbjList[i].VoucherLine_AccountItem
							this.fzcx(i)
							this.NowList[i].VoucherLine_JieMoney = this.AllbjList[i].VoucherLine_JieMoney
							this.NowList[i].VoucherLine_DaiMoney = this.AllbjList[i].VoucherLine_DaiMoney
							this.fanCresit();
							this.cesi();
							if(this.AllbjList[i].AssistItemJson != "null"){							
								var AssistItemJson = JSON.parse(this.AllbjList[i].AssistItemJson)
								console.log(AssistItemJson)
								console.log(AssistItemJson.length,"长度")
								for(var l = 0 ; l < AssistItemJson.length ; l++){
									if(AssistItemJson[l].AI_AssistItemType == "Department"){//部门
										this.NowList[i].fzbumen = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Customer"){//客户
										this.NowList[i].fzCustomer = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Product"){//产品
										this.NowList[i].fzProduct = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Company"){//公司
										this.NowList[i].fzCompany = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Employee"){//员工
										this.NowList[i].fzEmployee = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "daitan"){//待摊
										this.NowList[i].fzdaitan = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "Supplier"){//供应商
										this.NowList[i].fzSupplier = AssistItemJson[l].AI_Code
									}
									else if(AssistItemJson[l].AI_AssistItemType == "yajin"){//押金
										this.NowList[i].fzyajin = AssistItemJson[l].AI_Code
									}
								}
							}
						}
						/* this.loading2 = false */
					})
					.catch(err => {})
				})
			},
			dealF(e,cell,cellValue) {
				console.log("1111111",cellValue)
				if(cellValue == 0){
					return ''
				}else{
					return cellValue
				}	   
			},
			dealY(e,cell,cellValue) {
				console.log("1111111",cellValue)
				if(cellValue == 0){
					return ''
				}else{
					return cellValue
				}	   
			},
			getmingzi(){
				axios
					.post('getBorrowEmployee')
					.then(res=>{
			                console.log(res,"mingzi")
			                this.mingzi = res[0].Name
			            })
					.catch(err => {
			                console.log(err);
			           })
			},
			
			
		},
		created() {
			this.dangjuFrom();
//			this.AccountList();
//			this.kemuAbout();
//			this.assistdata();
			
		},
		watch: {
			'Debitnuber': 'cesi',
			'creditNuber': 'fanCresit',
			'ChiefAbsTract': 'ChiAbT',
		},

		mounted() {
			this.getList(); //列表数据
		},
		computed:{
			jiefang(){
				let sum = 0;
				this.NowList.forEach(item=>{
					sum+=Number(item.VoucherLine_JieMoney);
				})
				return Math.round(parseFloat(sum) * 100)/100;;
			},
			daifang(){
				let sum = 0;
				this.NowList.forEach(item=>{
					sum+=Number(item.VoucherLine_DaiMoney);
				})
				return Math.round(parseFloat(sum) * 100)/100;;
			},
		}
	};
</script>

<style scoped lang="scss">
	@import "../../../common/css/index.css";
	.toolbar {
		h2 {
			font-weight: 100;
			margin: 0 auto;
		}
	}
	
	h3 {
		/*margin: 10px 0;*/
	}
	
	.EmPennAge {
		h2 {
			font-weight: 100;
			margin: 0 auto;
		}
	}
	
	.HideTable {
		width: 99%;
		margin: 0 auto;
		background-color: #fff;
		border: 1px solid #dfe6ec;
		line-height: 40px;
		font-size: 14px;
		color: #1f2d3d;
	}
	.HideTable th{
		background-color: rgb(245,245,245);
	    text-align: center;
	    overflow: hidden;
	    border-right: 1px solid #ddd;
	    border-bottom: 1px solid #ddd;
	    padding: 0 18px;
	    color: #7e8796;
	    font-weight: normal;
	}
	#th1{
		width: 4%;
	}
	#th2{
		width: 11%;
	}
	#th3{
		width: 25%;
	}
	#th4{
		width: 38%;
	}
	#th5{
		width: 8%;
	}
	#th6{
		width: 8%;
	}
	#th7{
		width: 4%;
	}
	
	.bianjTable {
		width: 99%;
		margin: 0 auto;
		background-color: #fff;
		border: 1px solid #dfe6ec;
		line-height: 40px;
		font-size: 14px;
		color: #1f2d3d;
	}
	
	th {
		text-align: center;
	}
	
	td {
		text-align: center;
	}
	/* .addItem {
    display: block;
}

.el-form-item {
    margin-bottom: 12px;
}

.el-row {
    margin-bottom: 10px;
} */
	
	.add_btn {
		float: left;
		margin: 10px 0;
	}
	
	.el-dialog--small {
		width: 40%;
	}
	
	.el-dialog__body {
		padding-bottom: 0;
	}
	#linzi{
		position: absolute;
    	left: 44%;
    	font-size: 20px;
    	font-weight: bolder;
	}
	#wang{
		border: 1px solid #dfe6ec;
		height: 40px;
		margin-bottom: 27px;
		border-top: none;
		p{
			text-align: center;
    		line-height: 40px;
			
		}
	}
	#fu{
		height: 66px;
		margin-top: 10px;
		margin-bottom: 27px;
		p{
			text-align: center;
    		line-height: 66px;
			
		}
	}
</style>